package com.erp.remote.information;

import com.erp.util.AjaxResult;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.Map;

@RequestMapping("/information/wareHouse")
public interface WareHouseRemote {

    /**
     * 获取全部客户的数据
     *
     * @return
     */
    @RequestMapping("/allWareHouse")
    AjaxResult allWareHouse(@RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum, @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize);

    /**
     * 连表查
     *
     * @param companyId
     * @return
     */
    @RequestMapping("/selectWareHouseByCompanyId")
    AjaxResult selectWareHouseByCompanyId(@RequestParam("companyId") Integer companyId);

    @PostMapping("/selectWareHouseByCompanyIdPage")
    AjaxResult selectWareHouseByCompanyIdPage(@RequestBody Map<String, Object> params);
    /**
     * 只查仓库表有的字段
     *
     * @param companyId
     * @return
     */
    @RequestMapping("/selectWareHouseOnselfByCompanyId")
    AjaxResult selectWareHouseOnselfByCompanyId(@RequestParam("companyId") Integer companyId);


    @PostMapping("/updateWareHouse")
    AjaxResult updateWarehouse(@RequestBody Map<String, Object> param);


    @PostMapping("/addWareHouse")
    AjaxResult addWareHouse(@RequestBody Map<String, Object> param);

    /**
     * 校验仓库编码是否唯一
     *
     * @param wareHouseCode
     * @return
     */
    @RequestMapping("/checkWareHouseCodeOnly")
    AjaxResult checkWareHouseCodeOnly(@RequestParam("wareHouseCode") String wareHouseCode);

}
